package com.czxy.service;

import com.czxy.dao.ProductMapper;
import com.czxy.domain.Product;
import com.czxy.utils.MyBatisUtils;

import java.util.List;

public class ProductService {

    //最新商品
    public List<Product> findNewProducts(){

        ProductMapper mapper = MyBatisUtils.getMapper(ProductMapper.class);
        List<Product> newProducts = mapper.findNewProducts();
        MyBatisUtils.close();
        return newProducts;
    }

    //热门商品
    public List<Product> findHotProducts(){

        ProductMapper mapper = MyBatisUtils.getMapper(ProductMapper.class);
        List<Product> hotProducts = mapper.findHotProducts();
        MyBatisUtils.close();
        return hotProducts;
    }
}
